package com.weiwei.diancan.utils;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

import com.weiwei.diancan.MyApplicatin;

/**
 * Created by BMW on 2016/12/5.
 */
public class VersionUtils {
    public static String getVersion(){
        PackageManager manager;
        PackageInfo info = null;
        manager = MyApplicatin.inst.getPackageManager();
        try {
            info = manager.getPackageInfo(MyApplicatin.inst.getPackageName(), 0);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return info.versionName;
    }
}
